{extend name="public/base" /}

{block name="title"}商品列表{/block}

{block name="body"}
{include file="public/nav" parent_page_name= '商品管理' current_page_name = '商品列表'/}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <button class="layui-btn" onclick="xadmin.open('创建商品', '{:url(\'create\')}')">
                        <i class="layui-icon"></i>创建商品
                    </button>
                </div>
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>id</th>
                            <th>商品名称</th>
                            <th>标题</th>
                            <th>原价</th>
                            <th>现价</th>
                            <th>库存</th>
                            <th>发布时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach $list as $key => $data}
                        <tr>
                            <td>{$key+1}</td>
                            <td>{$data.name}</td>
                            <td>{$data.title}</td>
                            <td>{$data.raw_cost}</td>
                            <td>{$data.current_cost}</td>
                            <td>{$data.inventory}</td>
                            <td>{$data.gender_date}</td>
                            <td class="td-manage">
                                <a title="查看" onclick="xadmin.open('编辑', '{:url(\'edit\', [\'id\' => $data.id])}')"
                                   href="javascript:;">
                                    <i class="layui-icon">&#xe63c;</i></a>
                                <a title="删除" onclick="del(this, '{$data.id}')" href="javascript:;">
                                    <i class="layui-icon">&#xe640;</i></a>
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        <div>
                            {$list|raw}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="js"}
{include file="public/confirm_del"/}
{/block}
